import React from 'react';
import { connect } from 'dva/index';
import { Checkbox, Col, DatePicker, Form, Input, InputNumber, Radio, Row, Select, Tabs } from 'antd';
import PortSelect from '../common/portSelect';
import SingleDragger from "../common/SingleDragger";
import Constants from '../../utils/Constants';
import moment from 'moment'
const dateFormat = 'YYYY-MM-DD';
const FormItem = Form.Item;
const TabPane = Tabs.TabPane;
const CheckboxGroup = Checkbox.Group;
const RadioGroup = Radio.Group;
const R = require("ramda");

const orderEssentialInfo = Form.create()(class OrderEssentialInfo extends React.Component {
    constructor(props) {
        super(props);
    }

    form = {};
    flag = true;
    handleCollectForm = () => {
        this.props.form.validateFields({ force: true }, (errors, values) => {
            if (errors) {
                this.flag = false;
                return;
            } else {
                this.flag = true;
                values.issueDate = R.isNil(values.issueDate) || R.isEmpty(values.issueDate) ? "" : values.issueDate.format(dateFormat);
                values.realityEtdDate = R.isNil(values.realityEtdDate) || R.isEmpty(values.realityEtdDate) ? "" : values.realityEtdDate.format(dateFormat);
                values.realityTakeOffDate = R.isNil(values.realityTakeOffDate) || R.isEmpty(values.realityTakeOffDate) ? "" : values.realityTakeOffDate.format(dateFormat);
                values.realityTsDate = R.isNil(values.realityTsDate) || R.isEmpty(values.realityTsDate) ? "" : values.realityTsDate.format(dateFormat);
                values.realityEtaDate = R.isNil(values.realityEtaDate) || R.isEmpty(values.realityEtaDate) ? "" : values.realityEtaDate.format(dateFormat);
                values.openDate = R.isNil(values.openDate) || R.isEmpty(values.openDate) ? "" : values.openDate.format(dateFormat);
                values.closeDate = R.isNil(values.closeDate) || R.isEmpty(values.closeDate) ? "" : values.closeDate.format(dateFormat);
                values.truncationDate = R.isNil(values.truncationDate) || R.isEmpty(values.truncationDate) ? "" : values.truncationDate.format(dateFormat);
                values.distributionShipsDate = R.isNil(values.distributionShipsDate) || R.isEmpty(values.distributionShipsDate) ? "" : values.distributionShipsDate.format(dateFormat);
                values.cyCloseTime = R.isNil(values.cyCloseTime) || R.isEmpty(values.cyCloseTime) ? "" : values.cyCloseTime.format(dateFormat);
                values.vgmTime = R.isNil(values.vgmTime) || R.isEmpty(values.vgmTime) ? "" : values.vgmTime.format(dateFormat);
                values.siCutTime = R.isNil(values.siCutTime) || R.isEmpty(values.siCutTime) ? "" : values.siCutTime.format(dateFormat);
                values.emsTime = R.isNil(values.emsTime) || R.isEmpty(values.emsTime) ? "" : values.emsTime.format(dateFormat);
                values.amsTime = R.isNil(values.amsTime) || R.isEmpty(values.amsTime) ? "" : values.amsTime.format(dateFormat);
                values.isfTime = R.isNil(values.isfTime) || R.isEmpty(values.isfTime) ? "" : values.isfTime.format(dateFormat);
                values.etdDate = R.isNil(values.etdDate) || R.isEmpty(values.etdDate) ? "" : values.etdDate.format(dateFormat);
                values.takeOffDate = R.isNil(values.takeOffDate) || R.isEmpty(values.takeOffDate) ? "" : values.takeOffDate.format(dateFormat);
                values.tsDate = R.isNil(values.tsDate) || R.isEmpty(values.tsDate) ? "" : values.tsDate.format(dateFormat);
                values.etaDate = R.isNil(values.etaDate) || R.isEmpty(values.etaDate) ? "" : values.etaDate.format(dateFormat);
                values.trailerDate = R.isNil(values.trailerDate) || R.isEmpty(values.trailerDate) ? "" : values.trailerDate.format(dateFormat);
                values.declareDate = R.isNil(values.declareDate) || R.isEmpty(values.declareDate) ? "" : values.declareDate.format(dateFormat);
                values.passTime = R.isNil(values.passTime) || R.isEmpty(values.passTime) ? "" : values.passTime.format(dateFormat);
                values.siTime = R.isNil(values.siTime) || R.isEmpty(values.siTime) ? "" : values.siTime.format(dateFormat);
                values.chargeTime = R.isNil(values.chargeTime) || R.isEmpty(values.chargeTime) ? "" : values.chargeTime.format(dateFormat);
                this.form = { ...values };
            }
        })
        return this.flag;
    }

    checkOrderEssentialInfo = () => {
        if (this.handleCollectForm()) {
            return this.form;
        }
    }

    render() {
        let dataSource = this.props.order.dataSource ? this.props.order.dataSource : {};
        let berthingCompanyList = this.props.berthingCompany.berthingCompanyList ? this.props.berthingCompany.berthingCompanyList : [];
        let airCompanyList = this.props.airCompany.airCompanyList ? this.props.airCompany.airCompanyList : [];

        let formItemLayout = { labelCol: { span: 8 }, wrapperCol: { span: 14 } };
        let formItemLayout2 = { labelCol: { span: 4 }, wrapperCol: { span: 18 } };
        let formItemLayout3 = { labelCol: { span: 1 }, wrapperCol: { span: 22 } };
        const { getFieldDecorator } = this.props.form;

        let booking = this.props.order.booking ? this.props.order.booking : {};
        let company = this.props.order.company ? this.props.order.company : {};
        let deliveryReceipt = this.props.order.deliveryReceipt ? this.props.order.deliveryReceipt : {};
        let order = this.props.order.order ? this.props.order.order : {};

        let shippingSupplier = this.props.order.suppliers.shippingSupplier ? this.props.order.suppliers.shippingSupplier : {};
        //let trailerSupplier = this.props.order.suppliers.trailerSupplier ? this.props.order.suppliers.trailerSupplier : {};
        let airSupplier = this.props.order.suppliers.airSupplier ? this.props.order.suppliers.airSupplier : {};
        //let coSupplier = this.props.order.suppliers.coSupplier ? this.props.order.suppliers.coSupplier : {};
        //let declareSupplier = this.props.order.suppliers.declareSupplier ? this.props.order.suppliers.declareSupplier : {};
        let expressSupplier = this.props.order.suppliers.expressSupplier ? this.props.order.suppliers.expressSupplier : {};
        //let inspectionSupplier = this.props.order.suppliers.inspectionSupplier ? this.props.order.suppliers.inspectionSupplier : {};
        //let insuranceSupplier = this.props.order.suppliers.insuranceSupplier ? this.props.order.suppliers.insuranceSupplier : {};
        //let storageSupplier = this.props.order.suppliers.storageSupplier ? this.props.order.suppliers.storageSupplier : {};

        let traileList = this.props.supplier.traileList ? this.props.supplier.traileList : [];
        let declareList = this.props.supplier.declareList ? this.props.supplier.declareList : [];
        let insuranceList = this.props.supplier.insuranceList ? this.props.supplier.insuranceList : [];
        let inspectionList = this.props.supplier.inspectionList ? this.props.supplier.inspectionList : [];
        let storageList = this.props.supplier.storageList ? this.props.supplier.storageList : [];
        let coList = this.props.supplier.coList ? this.props.supplier.coList : [];

        let service = [deliveryReceipt.shipping && deliveryReceipt.shipping.includes("1") ? "1" : undefined,
        deliveryReceipt.portService && deliveryReceipt.portService.includes("1") ? "2" : undefined,
        deliveryReceipt.portService && deliveryReceipt.portService.includes("2") ? "3" : undefined,
        deliveryReceipt.vasService && deliveryReceipt.vasService.includes("2") ? "4" : undefined,
        deliveryReceipt.vasService && deliveryReceipt.vasService.includes("3") ? "5" : undefined
        ];

        let soUrl = booking.soUrl ? booking.soUrl : undefined;

        let berCompany =
            <Row>
                <Col span={12}>
                    <FormItem {...formItemLayout} label="船公司" hasFeedback>
                        {getFieldDecorator('berthingId', {
                            // rules: [{
                            //     required: true, message: '请选择船公司'
                            // }],
                            initialValue: (R.isNil(deliveryReceipt.berthingId) || R.isEmpty(deliveryReceipt.berthingId)) ? undefined : deliveryReceipt.berthingId + ""
                        })(
                            <Select style={{ width: '100%' }} disabled={true} showSearch placeholder="可通过输入关键字搜索" filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
                                {
                                    !R.isNil(berthingCompanyList) ? berthingCompanyList.map(item => {
                                        return (<Select.Option value={item.id + ""} key={item.id + ""}>{item.berthingCode}({item.berthingName})</Select.Option>);
                                    }) : ''
                                }
                            </Select>
                            )}
                    </FormItem>
                </Col>
                <Col span={12}>
                    <FormItem {...formItemLayout} label="船名" hasFeedback>
                        {getFieldDecorator('vesselName', {
                            rules: [{
                                required: false, message: '请输入船名！'
                            }],
                            initialValue: order.vesselName
                        })(
                            <Input disabled={order.bookingStatus == "2" ? true : this.props.disabled} maxLength="100" />
                            )}
                    </FormItem>
                </Col>
            </Row>

        let airCompany =
            <Row>
                <Col span={12}>
                    <FormItem {...formItemLayout} label="航空公司" hasFeedback>
                        {getFieldDecorator('aviationId', {
                            // rules: [{
                            //     required: true, message: '请选择航空公司'
                            // }],
                            initialValue: (R.isNil(deliveryReceipt.aviationId) || R.isEmpty(deliveryReceipt.aviationId)) ? undefined : deliveryReceipt.aviationId + ""
                        })(
                            <Select style={{ width: '100%' }} disabled={true} showSearch placeholder="可通过输入关键字搜索" filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
                                {
                                    !R.isNil(airCompanyList) ? airCompanyList.map(item => {
                                        return (<Select.Option value={item.id + ""} key={item.id + ""}>{item.aviationCode}({item.aviationName})</Select.Option>);
                                    }) : ''
                                }
                            </Select>
                            )}
                    </FormItem>
                </Col>
                <Col span={12}>
                    <FormItem {...formItemLayout} label="航班信息" hasFeedback>
                        {getFieldDecorator('voyageNumber', {
                            rules: [{
                                required: false, message: '请输入航班信息！'
                            }],
                            initialValue: order.voyageNumber
                        })(
                            <Input disabled={order.bookingStatus == "2" ? true : this.props.disabled} maxLength="100" />
                            )}
                    </FormItem>
                </Col>
            </Row>

        return (
            <Form>
                <Tabs tabPosition={'top'}>
                    <TabPane tab="基本信息" key="1">
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="客户名称" hasFeedback>
                                    {getFieldDecorator('companyName', {
                                        initialValue: company.companyName
                                    })(
                                        <Input disabled={true} maxLength="200" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="合约号" hasFeedback>
                                    {getFieldDecorator('contractNo', {
                                        initialValue: company.contractNo
                                    })(
                                        <Input disabled={true} maxLength="50" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        {deliveryReceipt.airFreight ? airCompany : deliveryReceipt.shipping ? berCompany : ""}
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="起运港" hasFeedback>
                                    {getFieldDecorator('loadingPort', {
                                        // rules: [{
                                        //     required: true, message: '请选择起运港',
                                        // }],
                                        initialValue: R.isEmpty(deliveryReceipt.loadingPort) ? [] : deliveryReceipt.loadingPort + ""
                                    })(
                                        <PortSelect disabled={true} style={{ width: '100%' }} />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="目的港" hasFeedback>
                                    {getFieldDecorator('destinationPort', {
                                        // rules: [{
                                        //     required: true, message: '请选择目的港',
                                        // }],
                                        initialValue: R.isEmpty(deliveryReceipt.destinationPort) ? [] : deliveryReceipt.destinationPort + ""
                                    })(
                                        <PortSelect disabled={true} style={{ width: '100%' }} />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="中转港" hasFeedback>
                                    {getFieldDecorator('transitPort', {
                                        rules: [{
                                            required: false, message: '请选择中转港',
                                        }],
                                        initialValue: R.isEmpty(order.transitPort) ? [] : order.transitPort
                                    })(
                                        <PortSelect disabled={order.bookingStatus == "2" ? true : this.props.disabled} style={{ width: '100%' }} />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="结算方式" hasFeedback>
                                    {getFieldDecorator('statementType', {
                                        // rules: [{
                                        //     required: true, message: '请输入结算方式！'
                                        // }],
                                        initialValue: company.statementType
                                    })(
                                        <Select disabled={true}>
                                            <Option value="0">票结</Option>
                                            <Option value="1">月结</Option>
                                        </Select>
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        {/* <Row>
                            <Col span={12} style={{ marginBottom: 10, marginLeft: 100 }}>
                                <a href="#" onClick={this.handleExportBooking.bind(this)} style={{ fontSize: '14px' }}>导出订舱单</a>
                            </Col>
                        </Row> */}
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="SO号" hasFeedback>
                                    {getFieldDecorator('soNo', {
                                        rules: [{
                                            required: false, message: '请输入SO号',
                                        }],
                                        initialValue: booking.soNo
                                    })(
                                        <Input disabled={order.bookingStatus == "2" ? true : this.props.disabled} maxLength="50" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label={<span>上传SO</span>} hasFeedback>
                                    <SingleDragger url={soUrl} ref="soUrl"
                                        dataSource={booking} module={Constants.BOOKING_MODULES[0]}
                                        disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                    />
                                </FormItem>
                            </Col>
                        </Row>
                    </TabPane>
                </Tabs>

                <Tabs tabPosition={'top'}>
                    <TabPane tab="供应商信息" key="1">
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="海运供应商" hasFeedback>
                                    {getFieldDecorator('shippingSupplier', {
                                        initialValue: (R.isNil(shippingSupplier.supplierCode) || R.isEmpty(shippingSupplier.supplierCode)) ? undefined : shippingSupplier.supplierCode
                                    })(
                                        <Input disabled={true} />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="拖车供应商" hasFeedback>
                                    {getFieldDecorator('trailerSupplierId', {
                                        rules: [{
                                            required: false, message: '请选择供应商代码'
                                        }],
                                        initialValue: (R.isNil(deliveryReceipt.trailerSupplierId) || R.isEmpty(deliveryReceipt.trailerSupplierId)) ? undefined : deliveryReceipt.trailerSupplierId + ""
                                    })(
                                        <Select style={{ width: '100%' }}
                                            showSearch placeholder="可通过输入关键字搜索"
                                            disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
                                            {
                                                !R.isNil(traileList) ? traileList.map(item => {
                                                    return (<Select.Option value={item.id + ""} key={item.id + ""}>{item.supplierCode}</Select.Option>);
                                                }) : ''
                                            }
                                        </Select>
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="报关供应商" hasFeedback>
                                    {getFieldDecorator('declareSupplierId', {
                                        rules: [{
                                            required: false, message: '请选择供应商代码'
                                        }],
                                        initialValue: (R.isNil(deliveryReceipt.declareSupplierId) || R.isEmpty(deliveryReceipt.declareSupplierId)) ? undefined : deliveryReceipt.declareSupplierId + ""
                                    })(
                                        <Select style={{ width: '100%' }}
                                            showSearch placeholder="可通过输入关键字搜索"
                                            disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
                                            {
                                                !R.isNil(declareList) ? declareList.map(item => {
                                                    return (<Select.Option value={item.id + ""} key={item.id + ""}>{item.supplierCode}</Select.Option>);
                                                }) : ''
                                            }
                                        </Select>
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="空运供应商" hasFeedback>
                                    {getFieldDecorator('airSupplier', {
                                        initialValue: (R.isNil(airSupplier.supplierCode) || R.isEmpty(airSupplier.supplierCode)) ? undefined : airSupplier.supplierCode
                                    })(
                                        <Input disabled={true} />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="快递供应商" hasFeedback>
                                    {getFieldDecorator('expressSupplier', {
                                        initialValue: (R.isNil(expressSupplier.supplierCode) || R.isEmpty(expressSupplier.supplierCode)) ? undefined : expressSupplier.supplierCode
                                    })(
                                        <Input disabled={true} />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="保险供应商" hasFeedback>
                                    {getFieldDecorator('insuranceSupplierId', {
                                        rules: [{
                                            required: false, message: '请选择供应商代码'
                                        }],
                                        initialValue: (R.isNil(deliveryReceipt.insuranceSupplierId) || R.isEmpty(deliveryReceipt.insuranceSupplierId)) ? undefined : deliveryReceipt.insuranceSupplierId + ""
                                    })(
                                        <Select style={{ width: '100%' }} 
                                                showSearch placeholder="可通过输入关键字搜索" 
                                                disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
                                            {
                                                !R.isNil(insuranceList) ? insuranceList.map(item => {
                                                    return (<Select.Option value={item.id + ""} key={item.id + ""}>{item.supplierCode}</Select.Option>);
                                                }) : ''
                                            }
                                        </Select>
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="商检供应商" hasFeedback>
                                    {getFieldDecorator('inspectionSupplierId', {
                                        rules: [{
                                            required: false, message: '请选择供应商代码'
                                        }],
                                        initialValue: (R.isNil(deliveryReceipt.inspectionSupplierId) || R.isEmpty(deliveryReceipt.inspectionSupplierId)) ? undefined : deliveryReceipt.inspectionSupplierId + ""
                                    })(
                                        <Select style={{ width: '100%' }}
                                                showSearch placeholder="可通过输入关键字搜索" 
                                                disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
                                            {
                                                !R.isNil(inspectionList) ? inspectionList.map(item => {
                                                    return (<Select.Option value={item.id + ""} key={item.id + ""}>{item.supplierCode}</Select.Option>);
                                                }) : ''
                                            }
                                        </Select>
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="产地证供应商" hasFeedback>
                                    {getFieldDecorator('coSupplierId', {
                                        rules: [{
                                            required: false, message: '请选择供应商代码'
                                        }],
                                        initialValue: (R.isNil(deliveryReceipt.coSupplierId) || R.isEmpty(deliveryReceipt.coSupplierId)) ? undefined : deliveryReceipt.coSupplierId + ""
                                    })(
                                        <Select style={{ width: '100%' }}
                                                showSearch placeholder="可通过输入关键字搜索" 
                                                disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
                                            {
                                                !R.isNil(coList) ? coList.map(item => {
                                                    return (<Select.Option value={item.id + ""} key={item.id + ""}>{item.supplierCode}</Select.Option>);
                                                }) : ''
                                            }
                                        </Select>
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="仓内装供应商" hasFeedback>
                                    {getFieldDecorator('storageSupplierId', {
                                        rules: [{
                                            required: false, message: '请选择供应商代码'
                                        }],
                                        initialValue: (R.isNil(deliveryReceipt.storageSupplierId) || R.isEmpty(deliveryReceipt.storageSupplierId)) ? undefined : deliveryReceipt.storageSupplierId + ""
                                    })(
                                        <Select style={{ width: '100%' }} 
                                                showSearch placeholder="可通过输入关键字搜索" 
                                                disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
                                            {
                                                !R.isNil(storageList) ? storageList.map(item => {
                                                    return (<Select.Option value={item.id + ""} key={item.id + ""}>{item.supplierCode}</Select.Option>);
                                                }) : ''
                                            }
                                        </Select>
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                    </TabPane>
                </Tabs>

                <Tabs tabPosition={'top'}>
                    <TabPane tab="服务信息" key="1">
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="提单方式">
                                    {getFieldDecorator('billType', {
                                        rules: [{
                                            required: true, message: '请选择提单方式',
                                        }],
                                        initialValue: order.billType
                                    })(
                                        <RadioGroup disabled={order.bookingStatus == "2" ? true : this.props.disabled}>
                                            <Radio value="1">MBL</Radio>
                                            <Radio value="2">HBL</Radio>
                                        </RadioGroup>
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label={'出单方式'}>
                                    {getFieldDecorator('issueType', {
                                        rules: [{
                                            required: true, message: '请选择出单方式',
                                        }],
                                        initialValue: order.issueType
                                    })(
                                        <Select style={{ width: "100%" }} disabled={order.bookingStatus == "2" ? true : this.props.disabled} allowClear>
                                            <Select.Option value="1">正本</Select.Option>
                                            <Select.Option value="2">电放</Select.Option>
                                            <Select.Option value="3">SWB</Select.Option>
                                        </Select>
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="MBL NO." hasFeedback>
                                    {getFieldDecorator('mblNo', {
                                        rules: [{
                                            required: true, message: '请输入MBL NO.',
                                        }],
                                        initialValue: order.mblNo
                                    })(
                                        <Input disabled={order.bookingStatus == "2" ? true : this.props.disabled} maxLength="18" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="HBL NO." hasFeedback>
                                    {getFieldDecorator('hblNo', {
                                        rules: [{
                                            required: this.props.form.getFieldValue('billType') == "2" ? true : false, message: '请输入HBL NO.',
                                        }],
                                        initialValue: order.hblNo
                                    })(
                                        <Input disabled={order.bookingStatus == "2" ? true : this.props.disabled} maxLength="18" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="签发日期" hasFeedback>
                                    {getFieldDecorator('issueDate', {
                                        rules: [{
                                            required: true, message: '请选择签发日期'
                                        }],
                                        initialValue: (R.isNil(order.issueDate) || R.isEmpty(order.issueDate)) ? undefined : moment(order.issueDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled} style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" placeholder="请选择有效开始时间" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={24}>
                                <FormItem {...formItemLayout2} label={'服务类型'}>
                                    {getFieldDecorator('service', {
                                        initialValue: service
                                    })(
                                        <CheckboxGroup style={{ width: 800 }} disabled={true}>
                                            <Checkbox value="1">整柜</Checkbox>
                                            <Checkbox value="2">拖车</Checkbox>
                                            <Checkbox value="3">报关</Checkbox>
                                            <Checkbox value="4">保险</Checkbox>
                                            <Checkbox value="5">商检</Checkbox>
                                        </CheckboxGroup>
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={2} style={{ marginLeft: 88 }}>
                                <span><font size="2">柜型/柜量 :</font></span>
                            </Col>
                            <Col span={4}>
                                <FormItem {...formItemLayout3}>
                                    {getFieldDecorator('size20gp', {
                                        initialValue: deliveryReceipt.size20gp
                                    })(
                                        <InputNumber disabled={true} min={0} maxLength="4" style={{ width: '100%' }} placeholder="数量" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={2}>
                                <span><font size="2">*20GP</font></span>
                            </Col>
                            <Col span={4}>
                                <FormItem {...formItemLayout3}>
                                    {getFieldDecorator('weight20gp', {
                                        initialValue: deliveryReceipt.weight20gp
                                    })(
                                        <InputNumber disabled={true} min={0} maxLength="18" style={{ width: '100%' }} placeholder="重量" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={2}>
                                <span><font size="2">KGS</font></span>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={3} style={{ marginLeft: 50 }}>
                            </Col>
                            <Col span={4}>
                                <FormItem {...formItemLayout3}>
                                    {getFieldDecorator('size40gp', {
                                        initialValue: deliveryReceipt.size40gp
                                    })(
                                        <InputNumber disabled={true} min={0} maxLength="4" style={{ width: '100%' }} placeholder="数量" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={2}>
                                <span><font size="2">*40GP</font></span>
                            </Col>
                            <Col span={4}>
                                <FormItem {...formItemLayout3}>
                                    {getFieldDecorator('weight40gp', {
                                        initialValue: deliveryReceipt.weight40gp
                                    })(
                                        <InputNumber disabled={true} min={0} maxLength="18" style={{ width: '100%' }} placeholder="重量" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={2}>
                                <span><font size="2">KGS</font></span>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={3} style={{ marginLeft: 50 }}>
                            </Col>
                            <Col span={4}>
                                <FormItem {...formItemLayout3}>
                                    {getFieldDecorator('size40hq', {
                                        initialValue: deliveryReceipt.size40hq
                                    })(
                                        <InputNumber disabled={true} min={0} maxLength="4" style={{ width: '100%' }} placeholder="数量" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={2}>
                                <span><font size="2">*40HQ</font></span>
                            </Col>
                            <Col span={4}>
                                <FormItem {...formItemLayout3}>
                                    {getFieldDecorator('weight40hq', {
                                        initialValue: deliveryReceipt.weight40hq
                                    })(
                                        <InputNumber disabled={true} min={0} maxLength="18" style={{ width: '100%' }} placeholder="重量" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={2}>
                                <span><font size="2">KGS</font></span>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={2} style={{ marginLeft: 88 }}>
                                <span><font size="2">重量/体积 :</font></span>
                            </Col>
                            <Col span={4}>
                                <FormItem {...formItemLayout3}>
                                    {getFieldDecorator('totalNum', {
                                        initialValue: deliveryReceipt.totalNum
                                    })(
                                        <InputNumber disabled={order.bookingStatus == "2" ? true : this.props.disabled} min={0} maxLength="4" style={{ width: '100%' }} />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={2}>
                                <span><font size="2">PKG</font></span>
                            </Col>
                            <Col span={4}>
                                <FormItem {...formItemLayout3}>
                                    {getFieldDecorator('volume', {
                                        initialValue: deliveryReceipt.volume
                                    })(
                                        <InputNumber disabled={order.bookingStatus == "2" ? true : this.props.disabled} min={0} maxLength="18" style={{ width: '100%' }} placeholder="体积" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={2}>
                                <span><font size="2">CBM</font></span>
                            </Col>
                            <Col span={4}>
                                <FormItem {...formItemLayout3}>
                                    {getFieldDecorator('volumeWeight', {
                                        initialValue: deliveryReceipt.volumeWeight
                                    })(
                                        <InputNumber disabled={order.bookingStatus == "2" ? true : this.props.disabled} min={0} maxLength="18" style={{ width: '100%' }} placeholder="重量" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={2}>
                                <span><font size="2">KGS</font></span>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="柜号" hasFeedback>
                                    {getFieldDecorator('cntrNo', {
                                        rules: [{
                                            required: false, message: '请输入柜号',
                                        }],
                                        initialValue: order.cntrNo
                                    })(
                                        <Input disabled={order.bookingStatus == "2" ? true : this.props.disabled} maxLength="18" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="封号" hasFeedback>
                                    {getFieldDecorator('sealNumber', {
                                        rules: [{
                                            required: false, message: '请输入封号',
                                        }],
                                        initialValue: order.sealNumber
                                    })(
                                        <Input disabled={order.bookingStatus == "2" ? true : this.props.disabled} maxLength="18" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                    </TabPane>
                </Tabs>

                <Tabs tabPosition={'top'}>
                    <TabPane tab="时间节点" key="1">
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="开仓时间" hasFeedback>
                                    {getFieldDecorator('openDate', {

                                        rules: [{
                                            required:
                                                this.props.form.getFieldValue('shippingSupplier') ||     //海运供应商   海运服务所有
                                                    this.props.form.getFieldValue('trailerSupplierId') ||      //拖车供应商   拖车
                                                    // this.props.form.getFieldValue('declareSupplierId')||      //报关供应商   报关
                                                    this.props.form.getFieldValue('airSupplier')         //空运供应商   空运 + 空π
                                                    // this.props.form.getFieldValue('expressSupplier')||      //快递供应商   快递
                                                    // this.props.form.getFieldValue('insuranceSupplierId')||    //保险供应商   保险
                                                    // this.props.form.getFieldValue('inspectionSupplierId')||   //商检供应商  商检
                                                    // this.props.form.getFieldValue('coSupplierId')||           //产地证供应商 产地证
                                                    // this.props.form.getFieldValue('storageSupplierId')        //仓内装供应商 仓内
                                                    ? true : false, message: '请选择开仓时间'


                                            //shippingSupplier  海运供应商   海运服务所有
                                            //trailerSupplierId   拖车供应商   拖车
                                            //declareSupplierId   报关供应商   报关
                                            //airSupplier       空运供应商   空运 + 空π
                                            //expressSupplier	快递供应商   快递
                                            //insuranceSupplierId 保险供应商   保险
                                            //inspectionSupplierId 商检供应商  商检
                                            //coSupplierId     	产地证供应商 产地证
                                            //storageSupplierId   仓内装供应商 仓内
                                        }],


                                        initialValue: (R.isNil(booking.openDate) || R.isEmpty(booking.openDate)) ? undefined : moment(booking.openDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="截仓时间" hasFeedback>
                                    {getFieldDecorator('closeDate', {
                                        rules: [{
                                            required:
                                                this.props.form.getFieldValue('shippingSupplier') ||     //海运供应商   海运服务所有
                                                    this.props.form.getFieldValue('trailerSupplierId') ||      //拖车供应商   拖车
                                                    // this.props.form.getFieldValue('declareSupplierId')||      //报关供应商   报关
                                                    this.props.form.getFieldValue('airSupplier') ||          //空运供应商   空运 + 空π
                                                    this.props.form.getFieldValue('expressSupplier')     //快递供应商   快递
                                                    // this.props.form.getFieldValue('insuranceSupplierId')||    //保险供应商   保险
                                                    // this.props.form.getFieldValue('inspectionSupplierId')||   //商检供应商  商检
                                                    // this.props.form.getFieldValue('coSupplierId')||           //产地证供应商 产地证
                                                    // this.props.form.getFieldValue('storageSupplierId')        //仓内装供应商 仓内
                                                    ? true : false, message: '请选择截仓时间'

                                        }],
                                        initialValue: (R.isNil(booking.closeDate) || R.isEmpty(booking.closeDate)) ? undefined : moment(booking.closeDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="截重时间" hasFeedback>
                                    {getFieldDecorator('truncationDate', {
                                        rules: [{
                                            required:
                                                this.props.form.getFieldValue('shippingSupplier') ||     //海运供应商   海运服务所有
                                                    this.props.form.getFieldValue('trailerSupplierId')      //拖车供应商   拖车
                                                    // this.props.form.getFieldValue('declareSupplierId')||      //报关供应商   报关
                                                    // this.props.form.getFieldValue('airSupplier')||          //空运供应商   空运 + 空π
                                                    // this.props.form.getFieldValue('expressSupplier')||      //快递供应商   快递
                                                    // this.props.form.getFieldValue('insuranceSupplierId')||    //保险供应商   保险
                                                    // this.props.form.getFieldValue('inspectionSupplierId')||   //商检供应商  商检
                                                    // this.props.form.getFieldValue('coSupplierId')||           //产地证供应商 产地证
                                                    // this.props.form.getFieldValue('storageSupplierId')        //仓内装供应商 仓内
                                                    ? true : false, message: '请选择截重时间'
                                            // coSupplierId   产地证

                                        }],
                                        initialValue: (R.isNil(booking.truncationDate) || R.isEmpty(booking.truncationDate)) ? undefined : moment(booking.truncationDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="配船时间" hasFeedback>
                                    {getFieldDecorator('distributionShipsDate', {
                                        rules: [{
                                            required:
                                                this.props.form.getFieldValue('shippingSupplier') ||     //海运供应商   海运服务所有
                                                    // this.props.form.getFieldValue('trailerSupplierId')||      //拖车供应商   拖车
                                                    this.props.form.getFieldValue('declareSupplierId')      //报关供应商   报关
                                                    // this.props.form.getFieldValue('airSupplier')||          //空运供应商   空运 + 空π
                                                    // this.props.form.getFieldValue('expressSupplier')||      //快递供应商   快递
                                                    // this.props.form.getFieldValue('insuranceSupplierId')||    //保险供应商   保险
                                                    // this.props.form.getFieldValue('inspectionSupplierId')||   //商检供应商  商检
                                                    // this.props.form.getFieldValue('coSupplierId')||           //产地证供应商 产地证
                                                    // this.props.form.getFieldValue('storageSupplierId')        //仓内装供应商 仓内
                                                    ? true : false, message: '请选择配船时间'

                                        }],
                                        initialValue: (R.isNil(booking.distributionShipsDate) || R.isEmpty(booking.distributionShipsDate)) ? undefined : moment(booking.distributionShipsDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="截关时间" hasFeedback>
                                    {getFieldDecorator('cyCloseTime', {
                                        rules: [{
                                            required:
                                                this.props.form.getFieldValue('shippingSupplier') ||     //海运供应商   海运服务所有
                                                    // this.props.form.getFieldValue('trailerSupplierId')||      //拖车供应商   拖车
                                                    this.props.form.getFieldValue('declareSupplierId') ||      //报关供应商   报关
                                                    this.props.form.getFieldValue('airSupplier')         //空运供应商   空运 + 空π
                                                    // this.props.form.getFieldValue('expressSupplier')||      //快递供应商   快递
                                                    // this.props.form.getFieldValue('insuranceSupplierId')||    //保险供应商   保险
                                                    // this.props.form.getFieldValue('inspectionSupplierId')||   //商检供应商  商检
                                                    // this.props.form.getFieldValue('coSupplierId')||           //产地证供应商 产地证
                                                    // this.props.form.getFieldValue('storageSupplierId')        //仓内装供应商 仓内
                                                    ? true : false, message: '请选择截关时间'
                                            //coSupplierId 产地证
                                        }],
                                        initialValue: (R.isNil(booking.cyCloseTime) || R.isEmpty(booking.cyCloseTime)) ? undefined : moment(booking.cyCloseTime, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="截VGM时间" hasFeedback>
                                    {getFieldDecorator('vgmTime', {
                                        rules: [{
                                            required:
                                                this.props.form.getFieldValue('shippingSupplier') ||     //海运供应商   海运服务所有
                                                    this.props.form.getFieldValue('trailerSupplierId') ||      //拖车供应商   拖车
                                                    // this.props.form.getFieldValue('declareSupplierId')||      //报关供应商   报关
                                                    this.props.form.getFieldValue('airSupplier')          //空运供应商   空运 + 空π
                                                    // this.props.form.getFieldValue('expressSupplier')||      //快递供应商   快递
                                                    // this.props.form.getFieldValue('insuranceSupplierId')||    //保险供应商   保险
                                                    // this.props.form.getFieldValue('inspectionSupplierId')||   //商检供应商  商检
                                                    // this.props.form.getFieldValue('coSupplierId')||           //产地证供应商 产地证
                                                    // this.props.form.getFieldValue('storageSupplierId')        //仓内装供应商 仓内
                                                    ? true : false, message: '请选择截VGM时间'

                                        }],
                                        initialValue: (R.isNil(booking.vgmTime) || R.isEmpty(booking.vgmTime)) ? undefined : moment(booking.vgmTime, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="截补料时间" hasFeedback>
                                    {getFieldDecorator('siCutTime', {
                                        rules: [{
                                            required:
                                                this.props.form.getFieldValue('shippingSupplier') ||     //海运供应商   海运服务所有
                                                    // this.props.form.getFieldValue('trailerSupplierId')||      //拖车供应商   拖车
                                                    // this.props.form.getFieldValue('declareSupplierId')||      //报关供应商   报关
                                                    this.props.form.getFieldValue('airSupplier')          //空运供应商   空运 + 空π
                                                    // this.props.form.getFieldValue('expressSupplier')||      //快递供应商   快递
                                                    // this.props.form.getFieldValue('insuranceSupplierId')||    //保险供应商   保险
                                                    // this.props.form.getFieldValue('inspectionSupplierId')||   //商检供应商  商检
                                                    // this.props.form.getFieldValue('coSupplierId')||           //产地证供应商 产地证
                                                    // this.props.form.getFieldValue('storageSupplierId')        //仓内装供应商 仓内
                                                    ? true : false, message: '请选择截补料时间'

                                        }],
                                        initialValue: (R.isNil(booking.siCutTime) || R.isEmpty(booking.siCutTime)) ? undefined : moment(booking.siCutTime, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="截EMS时间" hasFeedback>
                                    {getFieldDecorator('emsTime', {
                                        // rules: [{
                                        //     required: true, message: '请选择截EMS时间'
                                        // }],
                                        initialValue: (R.isNil(booking.emsTime) || R.isEmpty(booking.emsTime)) ? undefined : moment(booking.emsTime, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="截AMS时间" hasFeedback>
                                    {getFieldDecorator('amsTime', {
                                        // rules: [{
                                        //     required: true, message: '请选择截AMS时间'
                                        // }],
                                        initialValue: (R.isNil(booking.amsTime) || R.isEmpty(booking.amsTime)) ? undefined : moment(booking.amsTime, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="截ISF时间" hasFeedback>
                                    {getFieldDecorator('isfTime', {
                                        // rules: [{
                                        //     required: true, message: '请选择截ISF时间'
                                        // }],
                                        initialValue: (R.isNil(booking.isfTime) || R.isEmpty(booking.isfTime)) ? undefined : moment(booking.isfTime, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="开船时间" hasFeedback>
                                    {getFieldDecorator('etdDate', {
                                        rules: [{
                                            required:
                                                this.props.form.getFieldValue('shippingSupplier') ||     //海运供应商   海运服务所有
                                                    // this.props.form.getFieldValue('trailerSupplierId')&&      //拖车供应商   拖车
                                                    this.props.form.getFieldValue('declareSupplierId')      //报关供应商   报关
                                                    // this.props.form.getFieldValue('airSupplier')          //空运供应商   空运 + 空π
                                                    // this.props.form.getFieldValue('expressSupplier')&&      //快递供应商   快递
                                                    // this.props.form.getFieldValue('insuranceSupplierId')&&    //保险供应商   保险
                                                    // this.props.form.getFieldValue('inspectionSupplierId')&&   //商检供应商  商检
                                                    // this.props.form.getFieldValue('coSupplierId')&&           //产地证供应商 产地证
                                                    // this.props.form.getFieldValue('storageSupplierId')        //仓内装供应商 仓内
                                                    ? true : false, message: '请选择开船时间'
                                        }],
                                        initialValue: (R.isNil(booking.etdDate) || R.isEmpty(booking.etdDate)) ? undefined : moment(booking.etdDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="起飞时间" hasFeedback>
                                    {getFieldDecorator('takeOffDate', {
                                        rules: [{
                                            required:
                                                // this.props.form.getFieldValue('shippingSupplier')||     //海运供应商   海运服务所有
                                                // this.props.form.getFieldValue('trailerSupplierId')||      //拖车供应商   拖车
                                                // this.props.form.getFieldValue('declareSupplierId')||      //报关供应商   报关
                                                this.props.form.getFieldValue('airSupplier')          //空运供应商   空运 + 空π
                                                    // this.props.form.getFieldValue('expressSupplier')||      //快递供应商   快递
                                                    // this.props.form.getFieldValue('insuranceSupplierId')||    //保险供应商   保险
                                                    // this.props.form.getFieldValue('inspectionSupplierId')||   //商检供应商  商检
                                                    // this.props.form.getFieldValue('coSupplierId')||           //产地证供应商 产地证
                                                    // this.props.form.getFieldValue('storageSupplierId')        //仓内装供应商 仓内
                                                    ? true : false, message: '请选择起飞时间'
                                            //  coSupplierId  产地证  trailerSupplierId  拖车供应商    declareSupplierId 报关供应商
                                        }],
                                        initialValue: (R.isNil(booking.takeOffDate) || R.isEmpty(booking.takeOffDate)) ? undefined : moment(booking.takeOffDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="中转时间" hasFeedback>
                                    {getFieldDecorator('tsDate', {
                                        rules: [{
                                            required:
                                                this.props.form.getFieldValue('shippingSupplier') ||     //海运供应商   海运服务所有
                                                    // this.props.form.getFieldValue('trailerSupplierId')||      //拖车供应商   拖车
                                                    // this.props.form.getFieldValue('declareSupplierId')||      //报关供应商   报关
                                                    this.props.form.getFieldValue('airSupplier')          //空运供应商   空运 + 空π
                                                    // this.props.form.getFieldValue('expressSupplier')||      //快递供应商   快递
                                                    // this.props.form.getFieldValue('insuranceSupplierId')||    //保险供应商   保险
                                                    // this.props.form.getFieldValue('inspectionSupplierId')||   //商检供应商  商检
                                                    // this.props.form.getFieldValue('coSupplierId')||           //产地证供应商 产地证
                                                    // this.props.form.getFieldValue('storageSupplierId')        //仓内装供应商 仓内
                                                    ? true : false, message: '请选择中转时间'
                                            //  coSupplierId  产地证  trailerSupplierId  拖车供应商    declareSupplierId 报关供应商
                                        }],
                                        initialValue: (R.isNil(booking.tsDate) || R.isEmpty(booking.tsDate)) ? undefined : moment(booking.tsDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="预计到港时间" hasFeedback>
                                    {getFieldDecorator('etaDate', {
                                        rules: [{
                                            required:
                                                this.props.form.getFieldValue('shippingSupplier') ||     //海运供应商   海运服务所有
                                                    // this.props.form.getFieldValue('trailerSupplierId')||      //拖车供应商   拖车
                                                    // this.props.form.getFieldValue('declareSupplierId')||      //报关供应商   报关
                                                    this.props.form.getFieldValue('airSupplier') ||          //空运供应商   空运 + 空π
                                                    this.props.form.getFieldValue('expressSupplier')      //快递供应商   快递
                                                    // this.props.form.getFieldValue('insuranceSupplierId')||    //保险供应商   保险
                                                    // this.props.form.getFieldValue('inspectionSupplierId')||   //商检供应商  商检
                                                    // this.props.form.getFieldValue('coSupplierId')||           //产地证供应商 产地证
                                                    // this.props.form.getFieldValue('storageSupplierId')        //仓内装供应商 仓内
                                                    ? true : false, message: '请选择预计到港时间'

                                        }],
                                        initialValue: (R.isNil(booking.etaDate) || R.isEmpty(booking.etaDate)) ? undefined : moment(booking.etaDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                    </TabPane>
                </Tabs>

                <Tabs tabPosition={'top'}>
                    <TabPane tab="关键节点完成时间" key="1">
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="拖车时间" hasFeedback>
                                    {getFieldDecorator('trailerDate', {
                                        // rules: [{
                                        //     required: true, message: '请选择拖车时间'
                                        // }],
                                        initialValue: (R.isNil(order.trailerDate) || R.isEmpty(order.trailerDate)) ? undefined : moment(order.trailerDate, dateFormat)
                                    })(
                                        <DatePicker disabled={true}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="报关时间" hasFeedback>
                                    {getFieldDecorator('declareDate', {
                                        // rules: [{
                                        //     required: true, message: '请选择报关时间'
                                        // }],
                                        initialValue: (R.isNil(order.declareDate) || R.isEmpty(order.declareDate)) ? undefined : moment(order.declareDate, dateFormat)
                                    })(
                                        <DatePicker disabled={true}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="放行时间" hasFeedback>
                                    {getFieldDecorator('passTime', {
                                        // rules: [{
                                        //     required: true, message: '请选择放行时间'
                                        // }],
                                        initialValue: (R.isNil(order.passTime) || R.isEmpty(order.passTime)) ? undefined : moment(order.passTime, dateFormat)
                                    })(
                                        <DatePicker disabled={true}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="补料时间" hasFeedback>
                                    {getFieldDecorator('siTime', {
                                        initialValue: (R.isNil(order.siTime) || R.isEmpty(order.siTime)) ? undefined : moment(order.siTime, dateFormat)
                                    })(
                                        <DatePicker disabled={true}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="实际开船时间" hasFeedback>
                                    {getFieldDecorator('realityEtdDate', {
                                        // rules: [{
                                        //     required: true, message: '请选择实际开船时间'
                                        // }],
                                        initialValue: (R.isNil(order.realityEtdDate) || R.isEmpty(order.realityEtdDate)) ? undefined : moment(order.realityEtdDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="实际起飞时间" hasFeedback>
                                    {getFieldDecorator('realityTakeOffDate', {
                                        // rules: [{
                                        //     required: true, message: '请选择实际起飞时间'
                                        // }],
                                        initialValue: (R.isNil(order.realityTakeOffDate) || R.isEmpty(order.realityTakeOffDate)) ? undefined : moment(order.realityTakeOffDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="实际中转时间" hasFeedback>
                                    {getFieldDecorator('realityTsDate', {
                                        // rules: [{
                                        //     required: true, message: '请选择实际中转时间'
                                        // }],
                                        initialValue: (R.isNil(order.realityTsDate) || R.isEmpty(order.realityTsDate)) ? undefined : moment(order.realityTsDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="实际到港时间" hasFeedback>
                                    {getFieldDecorator('realityEtaDate', {
                                        // rules: [{
                                        //     required: true, message: '请选择实际到港时间'
                                        // }],
                                        initialValue: (R.isNil(order.realityEtaDate) || R.isEmpty(order.realityEtaDate)) ? undefined : moment(order.realityEtaDate, dateFormat)
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" ? true : this.props.disabled}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem {...formItemLayout} label="操作时间" hasFeedback>
                                    {getFieldDecorator('chargeTime', {
                                        // rules: [{
                                        //     required: true, message: '请选择操作时间'
                                        // }],
                                        initialValue: order.chargeTime ? moment(order.chargeTime, dateFormat) : undefined
                                    })(
                                        <DatePicker disabled={order.bookingStatus == "2" || this.props.disabled || order.chargeTime}
                                            style={{ width: '100%' }}
                                            showTime={{ format: 'YYYY-MM-DD' }}
                                            format="YYYY-MM-DD" />
                                        )}
                                </FormItem>
                            </Col>
                        </Row>
                    </TabPane>
                </Tabs>
            </Form >
        )
    }
})

function mapStateToProps(state) {
    return {
        loading: state.loading.models.order, order: state.order, supplier: state.supplier, berthingCompany: state.berthingCompany, airCompany: state.airCompany
    };
}

export default connect(mapStateToProps)(orderEssentialInfo);